package com.macro.mall.mapper;

import com.macro.mall.dto.admin.AdminClockQueryDTO;
import com.macro.mall.dto.admin.AdminPreClockDTO;
import com.macro.mall.dto.admin.AdminUnClockListDTO;
import com.macro.mall.dto.applet.AppletClockQueryDTO;
import com.macro.mall.dto.applet.AppletRankDTO;
import com.macro.mall.dto.applet.QuerySignListDTO;
import com.macro.mall.model.SitQuietlyClock;
import com.macro.mall.model.SitQuietlyClockExample;
import com.macro.mall.vo.admin.AdminSitQuietlyClockVO;
import com.macro.mall.vo.admin.AdminUnClockListVO;
import com.macro.mall.vo.admin.AdminUserNameVO;
import com.macro.mall.vo.admin.UnClockUserVO;
import com.macro.mall.vo.applet.AppletMemberSignInfoVO;
import com.macro.mall.vo.applet.AppletRankVO;
import com.macro.mall.vo.applet.AppletSitQuietlyClockVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SitQuietlyClockMapper {
    long countByExample(SitQuietlyClockExample example);

    int deleteByExample(SitQuietlyClockExample example);

    int deleteByPrimaryKey(Long id);

    int insert(SitQuietlyClock row);

    int insertSelective(SitQuietlyClock row);

    List<SitQuietlyClock> selectByExample(SitQuietlyClockExample example);

    SitQuietlyClock selectByPrimaryKey(Long id);

    int updateByExampleSelective(@Param("row") SitQuietlyClock row, @Param("example") SitQuietlyClockExample example);

    int updateByExample(@Param("row") SitQuietlyClock row, @Param("example") SitQuietlyClockExample example);

    int updateByPrimaryKeySelective(SitQuietlyClock row);

    int updateByPrimaryKey(SitQuietlyClock row);

    /**
     * sitQuietlyList
     *
     * @param req
     * @return
     */
    List<AdminSitQuietlyClockVO> sitQuietlyList(@Param("param") AdminClockQueryDTO req);

    /**
     * sitQuietlyListByApplet
     *
     * @param req
     * @return
     */
    List<AppletSitQuietlyClockVO> sitQuietlyListByApplet(@Param("param") AppletClockQueryDTO req);

    /**
     * 签到列表
     *
     * @param queryDto
     * @return
     */
    List<AppletMemberSignInfoVO> signList(@Param(value = "param") QuerySignListDTO queryDto);


    /**
     * 打卡列表查询
     *
     * @param req
     * @return
     */
    List<AdminUnClockListVO> unClockList(@Param(value = "param") AdminUnClockListDTO req);


    /**
     * 待打卡列表查询
     *
     * @param req
     * @return
     */
    List<String> preClockList(@Param(value = "param") AdminPreClockDTO req);

    /**
     * 待打卡列表查询
     *
     * @param req
     * @return
     */
    List<Long> preClockUserIdList(@Param(value = "param") AdminPreClockDTO req);

    /**
     * clockNumByType
     *
     * @param dateNo
     * @param type
     * @param sourceType
     * @return
     */
    Integer clockNumByType(@Param(value = "dateNo") Long dateNo, @Param(value = "type") Integer type, @Param(value = "sourceType") Integer sourceType);


    /**
     * 获取不同班级用户列表
     *
     * @param type
     * @return
     */
    List<AdminUserNameVO> listUserNames(@Param(value = "type") Integer type);

    /**
     * clockAll
     *
     * @param userId
     * @return
     */
    Integer clockAll(@Param(value = "userId") Long userId);

    /**
     * clockMonth
     *
     * @param userId
     * @return
     */
    Integer clockMonth(@Param(value = "userId") Long userId, @Param(value = "startDateNo") Long startDateNo, @Param(value = "endDateNo") Long endDateNo);


    /**
     * 获取当前本月旷卡人数
     *
     * @return
     */
    List<UnClockUserVO> listUnClock(@Param(value = "startDateNo") Long startDateNo, @Param(value = "endDateNo") Long endDateNo, @Param(value = "sourceType") Integer sourceType);


    /**
     * 获取排序列表
     * @param req
     * @return
     */
    List<AppletRankVO> rankList(@Param(value = "param") AppletRankDTO req);
}